// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

/** 新增数据库 新增数据库 POST /databaseManage/addDatabase */
export async function addDatabaseUsingPost(
  body: dataFactory.Pinyin__,
  options?: { [key: string]: any },
) {
  return request<dataFactory.R>('/databaseManage/addDatabase', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除数据库 通过ID删除数据库 DELETE /databaseManage/deleteDatabase/${param0} */
export async function deleteDatabaseUsingDelete(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: dataFactory.deleteDatabaseUsingDELETEParams,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<dataFactory.R>(`/databaseManage/deleteDatabase/${param0}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 获取数据库 通过ID获取数据库 GET /databaseManage/getDatabase/${param0} */
export async function getDatabaseUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: dataFactory.getDatabaseUsingGETParams,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<dataFactory.R>(`/databaseManage/getDatabase/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 分页查询数据库 分页查询数据库 GET /databaseManage/pageList */
export async function databasePageListUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: dataFactory.databasePageListUsingGETParams,
  options?: { [key: string]: any },
) {
  return request<dataFactory.R>('/databaseManage/pageList', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 更新数据库 更新数据库信息 PUT /databaseManage/updateDatabase */
export async function updateDatabaseUsingPut(
  body: dataFactory.UpdateDatabaseDTO,
  options?: { [key: string]: any },
) {
  return request<dataFactory.R>('/databaseManage/updateDatabase', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
